<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">


    <title>商品详情</title>

    <link href="../../resource/css/bootstrap.min.css?v=3.3.5" rel="stylesheet"
          th:href="@{/resource/css/bootstrap.min.css?v=3.3.5}"/>
    <link href="../../resource/hotui/css/font-awesome.min.css" rel="stylesheet"
          th:href="@{/resource/hotui/css/font-awesome.min.css}">
    <!-- Morris -->
    <link href="../../resource/hotui/css/plugins/morris/morris-0.4.3.min.css"
          rel="stylesheet" th:href="@{/resource/hotui/css/plugins/morris/morris-0.4.3.min.css}">
    <link href="../../resource/css/animate.min.css" rel="stylesheet" th:href="@{/resource/css/animate.min.css}"/>
    <link href="../../resource/hotui/css/style.min-1.0.8.css" rel="stylesheet"
          th:href="@{/resource/hotui/css/style.min-1.0.8.css}">
    <link href="../../resource/hotui/css/hotui.style.override.css"
          rel="stylesheet" th:href="@{/resource/hotui/css/hotui.style.override.css}"/>
</head>

<body class="gray-bg">
<div class="animated fadeInRight"
     style="padding:0 6px;position:fixed;width:100%;top: 0;z-index:101;">
    <div class="col-lg-12">
        <div class="ibox float-e-margins" style="margin-bottom:0;">
            <div class="ibox-title" style="padding: 14px 15px 11px;">
                <div class="form-inline">
                    <div class="form-group m-r-sm">
                        <label style="font-size: 17px; margin-top: 5px;">
                            <span th:text="${model.data.title}">数农旗舰店</span>

                            <span style="font-size: 13px;">
                                                <span class="color-primary" th:if="${model.auditStatus.code==1}"
                                                >审核通过</span>
                                                <span class="color-warning"
                                                      th:if="${model.auditStatus.code==0}">待审核</span>
                                                <span class="color-danger"
                                                      th:if="${model.auditStatus.code==2}">审核失败</span>
                            </span>
                        </label>
                    </div>
                    <button class="btn btn-success btn-sm" th:if="${model.auditStatus.code==0}"
                            th:onclick="handler.modifyAudit([[${model.merchantId}]])"
                            type="button">
                        审核
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="wrapper wrapper-content animated fadeInRight tooltip-demo" style="margin-top: 59px;" th:object="${model}">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="tabs-container">
                    <input id="merchantId" th:value="*{merchantId}" type="hidden"/>

                    <div class="ibox-title"
                         style="vertical-align: bottom;height: 100%;padding-left: 30px;border-left: 1px solid #e9ebed;border-right:1px solid #e9ebed;">
                        <h5 style="font-size: 18px;">
                            <img alt="" onerror="this.src='../../resource/img/d_head.jpeg'"
                                 src="../../resource/img/p2.jpg"
                                 style="width:100px;height:100px;"
                                 th:onerror="|this.src='@{/resource/img/d_head.jpeg}'|" th:src="*{data.avatar}">
                        </h5>
                        <div style="margin-left: 120px;width: 50%;margin-top: 6px;">
                            <h3 th:text="*{data.title}">数农旗舰店</h3>
                            <p style="width: 373px;height: 31px;" th:text="*{data.description}">
                            </p>
                            <p>创建时间：<span th:text="*{createTime}"></span></p>
                        </div>
                    </div>

                    <ul class="nav nav-tabs" style="margin-top: 20px;">
                        <li><a th:href="@{/merchant/detail(id=${model.merchantId})}" href="order_detail.html">基本信息</a>
                        </li>
                        <li th:class="${type==2?'active':''}" class="active"><a
                                th:href="@{/merchant/detail/advanceLog/2(userId=${model.merchantId})}"
                                href="order_detail.html">货款明细</a></li>
                        <li th:class="${type==3?'active':''}" class="active"><a
                                th:href="@{/merchant/detail/advanceLog/3(userId=${model.merchantId})}"
                                href="order_detail.html">待入账货款明细</a></li>
                        <li><a th:href="@{/merchant/detail/depositLogs(merchantId=${model.merchantId})}"
                               href="order_detail.html">保证金明细</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active">
                            <div class="panel-body">


                                <div class="row">
                                    <div class="col-sm-12">
                                        <div class="ibox float-e-margins">
                                            <div class="ibox-content p-xxs no-borders">
                                                <form id="searchForm" th:object="${condition}">
                                                    <input type="hidden" id="pageIndex" name="pageIndex"
                                                           th:value="${pageIndex}"/>
                                                    <input type="hidden" id="userId" name="userId"
                                                           th:value="*{userId}"/>
                                                    <div class="form-inline">
                                                        <div class="form-group m-r-sm">
                                                            <label class=" control-label" for="orderId">订单号：</label>
                                                            <input type="text" class="form-control input-sm mb10"
                                                                   id="orderId" th:value="*{orderId}" name="orderId"
                                                                   placeholder="订单号" style="width: 156px;"/>
                                                        </div>
                                                        <div class="form-group m-r-sm">
                                                            <label class=" control-label"
                                                                   for="createTimePick">变动时间：</label>
                                                            <input readonly type="text"
                                                                   class="form-control input-sm mb10 data-range-pick"
                                                                   id="createTimePick" name="createTimePick"
                                                                   start-element="#beginTime" end-element="#endTime"
                                                                   placeholder="开始时间-结束时间" style="width: 377px;"/>
                                                            <input type="hidden" th:value="*{beginTime}" id="beginTime"
                                                                   name="beginTime"/>
                                                            <input type="hidden" th:value="*{endTime}" id="endTime"
                                                                   name="endTime"/>
                                                        </div>
                                                        <div class="form-group m-r-sm">
                                                            <button type="button" onclick="logHandler.search(1)"
                                                                    class="btn btn-primary btn-sm m-b-none searchBtn">筛选
                                                            </button>
                                                            <button type="button" onclick="logHandler.searchAll()"
                                                                    class="btn btn-primary btn-sm m-b-none">显示全部
                                                            </button>
                                                        </div>
                                                    </div>
                                                </form>
                                                <p style="height: 10px;"></p>
                                                <table class="table table-bordered table-hover table-center">
                                                    <thead>
                                                    <tr>
                                                        <th>日志ID</th>
                                                        <th>类型</th>
                                                        <th>变动金额</th>
                                                        <th>变动前</th>
                                                        <th>变动后</th>
                                                        <th>订单号</th>
                                                        <th>充值编号</th>
                                                        <th>时间</th>
                                                        <th>备注</th>
                                                        <th>操作人</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    <tr th:each="log:${logs}">
                                                        <td th:text="${log.logId}"></td>
                                                        <td th:text="${log.logType.desc}"></td>
                                                        <td th:text="${log.amount}"></td>
                                                        <td th:text="${log.beforeAmount}"></td>
                                                        <td th:text="${log.afterAmount}"></td>
                                                        <td th:text="${log.orderId}"></td>
                                                        <td th:text="${log.rechargeId}"></td>
                                                        <td th:text="${#temporals.format(log.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                                                        <td th:text="${log.remark}"></td>
                                                        <td th:text="${log.opName}"></td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                                <p style="float: left; margin: 20px 0;">
                                                    共<span th:text="${totalRecords}"></span>条记录，当前第<span
                                                        th:text="${pageIndex}"></span>/<span
                                                        th:text="${totalPages==0?1:totalPages}"></span>，每页20条记录
                                                </p>
                                                <ul style="float: right;" class="pagination pagination-split">
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="../../resource/js/jquery.min2.2.4.js?v=2.1.4" th:src="@{/resource/js/jquery.min2.2.4.js?v=2.1.4}"></script>
<script src="../../resource/js/bootstrap.min.js?v=3.3.5" th:src="@{/resource/js/bootstrap.min.js?v=3.3.5}"></script>
<script src="../../resource/hotui/js/hot/bootstrap.hot.extra-utils.js"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-utils.js(123123)}"></script>
<script src="../../resource/hotui/js/hot/bootstrap.hot.extra-init.js"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-init.js}"></script>

<script src="../../resource/hotui/js/content.min.js" th:src="@{/resource/hotui/js/content.min.js}"></script>

<script th:inline="javascript" type="text/javascript">
    const pageIndex = /*[[${pageIndex}]]*/  1;
    const auditUri = /*[[@{/merchant/audit}]]*/  "";
    const totalPages = /*[[${totalPages}]]*/  0;
    const pageUri = /*[[@{/merchant/detail/advanceLog/}]]*/  "";
    const type = /*[[${type}]]*/  1;

    $(function () {
        //初始化分页
        var pageinate = new hot.paging(".pagination", pageIndex, totalPages, 7);

        pageinate.init(function (p) {
            logHandler.search(p)
        });
        $(document).keyup(function (event) {
            if (event.keyCode === 13) {
                $(".searchBtn").trigger("click");
            }
        });

    });

    var logHandler = {
        search: function (pageIndex) {
            $("input[name=pageIndex]").val(pageIndex);

            $("#searchForm").submit();
        },
        searchAll: function () {
            window.location.href = pageUri + type + "?userId=" + $("#userId").val();
        }
    }
</script>
<script>
</script>
</body>
</html>
